package com.marktim.pokerpoker.game;

import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.marktim.pokerpoker.R;
import com.marktim.pokerpoker.server.Server;
import com.marktim.pokerpoker.server.Server.ServerListener;
import com.marktim.pokerpoker.util.GameSettings;

public class ServerGameActivity extends Activity {

	private TextView testInfo;
	private Server server;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.game_server_test);

		testInfo = (TextView) findViewById(R.id.gameServerTestInfo);

		GameSettings gs = GameSettings.getInstance();

		server = new Server(gs.getName(), gs.getMaxPlayers(), gs.getChipValues(), gs.getChipCount(), gs.getSmallBlind(), gs.getBigBlind(),
				gs.isIncreaseBlinds());
		server.setListener(new ServerListener() {

			@Override
			public void onMessage(String message) {
				testInfo.setText(testInfo.getText() + "\n" + message);
			}
		});
	}

	@Override
	protected void onStop() {
		server.stop();
		super.onStop();
	}
}
